<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">  
    <title>校园一卡通</title>
    <meta name="description" content="">
    <meta name="HandheldFriendly" content="True">
    <meta name="MobileOptimized" content="320">
    <meta name="viewport" content="width=device-width, initial-scale=1, minimal-ui, user-scalable=no">
    <meta http-equiv="cleartype" content="o n">
    <meta name="format-detection" content="telephone=no">
   <link rel="stylesheet" href="/assets/store/bound/css/style.css">
    <link rel="stylesheet" href="/assets/store/bound/css/layer.css">
</head>
<body>

<div class="wraper">
    <input type="hidden" id="user_id" value="{BEESCRM:$data.user_id}">
    <input type="hidden" id="account_id" value="{BEESCRM:$account_id}">
    <input type="hidden" id="go" value="{BEESCRM:$go}">
    <div class="header">
        <!-- <a href="#" class="iconfont icon-zuo back"></a> -->
          <a href="javascript:history.go(-1)" class="iconfont icon-zuo back"></a>
        <div class="title text-center font-16">个人中心</div>
    </div>
    <div class="main-card">
        <div class="user flex">
            <div class="logo">
                <img src="/assets/store/bound/images/logo.png" alt="">
            </div>
            <div>
                <p>校园卡</p>
                <p class="font-12 Student_ID">{BEESCRM:$data.number}</p>
            </div>
              <div>
                <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
            </div>
            <div>
                <p>学生账号</p>
                <p class="font-12 Student_ID1">{BEESCRM:$data.number2}</p>
            </div>
        </div>
        <div class="text-right font-16">
            余额 <span>0.00</span> 元
        </div>
        <div class="bg-logo">
            <img src="/assets/store/bound/images/logo.png" alt="">
        </div>
    </div>
       <div class="classify">
         <!--    <a href="#" class="list flex-between gray">
                <div class="iconfont icon-logo icon-chongzhi"></div>
                <div class="right flex-between">
                    <div>充值</div>
                    <div class="iconfont  icon-jiantou"></div>
                </div>
            </a>
            <a href="#" class="list flex-between gray">
                <div class="iconfont icon-logo icon-chongdianjilu font-20"></div>
                <div class="right flex-between">
                    <div>充值记录</div>
                    <div class="iconfont  icon-jiantou"></div>
                </div>
            </a> -->
            <a href="#" class="list flex-between gray js_unbundle" >
                <div class="iconfont icon-logo icon-bangqiajiebangwenti font-20"></div>
                <div class="right flex-between">
                    <div>解绑</div>
                    <div class="iconfont  icon-jiantou"></div>
                </div>
            </a>

        </div>
         <div class="pop-box hide">
            <div class="pop-hint text-center">
                <div class="top"></div>
                <div class="pop-title font-16">
                    请输入验证密码
                </div>
                <div class="password">
                    <input type="text" id="last_six_bit" class="text-center" placeholder="密码为校园卡密码">
                </div>
                <a href="#" class="btn text-center btn-ok">确定</a>
                <p class="font-12 gray"><span class="red">注：</span>您正在对您的校园卡进行操作</p>
                <div class="close iconfont icon-chacha1">
                </div>
            </div>
        </div> 
</div>
</body>
<script src="/assets/store/bound/js/jquery-2.1.0.min.js"></script>
<script src="/assets/store/bound/js/layer.js"></script>
<script src="/assets/store/bound/js/public.js"></script>
<script>
    var height=$(window).height();
    $('.wraper').css('minHeight',height);

    $(function () {
        var Student_ID=$('.Student_ID').text();
        var lenght=Student_ID.length;
        if(lenght>8){
            var lenght2=lenght-8;
            var text1=Student_ID.substr(0,4);
            var text2=Student_ID.substring(lenght-4,lenght);
            var value='';
            for(var i=1;i<=lenght2;i++){
                value+='*';
            }
            $(".Student_ID").html(text1+value+text2);
        }
        
    });

    $(function () {
        var Student_ID1=$('.Student_ID1').text();
        var lenght=Student_ID1.length;
        if(lenght>8){
            var lenght2=lenght-8;
            var text1=Student_ID1.substr(0,4);
            var text2=Student_ID1.substring(lenght-4,lenght);
            var value='';
            for(var i=1;i<=lenght2;i++){
                value+='*';
            }
            $(".Student_ID1").html(text1+value+text2);
        }
        
    });

   
     $('.js_unbundle').click(function () {
         $('.pop-box').removeClass('hide');
    });
    $('.close').click(function () {
        $('.pop-box').addClass('hide');
    });
    // $('.btn-ok').click(function () {
    //     fm.alert('密码错误');
    // });
    $('.btn-ok').click(function () {
        var last_six_bit = $("#last_six_bit").val();
        if(!last_six_bit){
            fm.alert("请输入校园卡密码");
            return false;
        }
        var user_id = $('#user_id').val();
        var go = $('#go').val();
        var account_id = $('#account_id').val();
        $.ajax({
            url:"{BEESCRM::U('/base/store/unbound',array(store_id=>$store_id))}/user_id/"+user_id,
            type:"POST",
            dataType:"json",
            data:{last_six_bit:last_six_bit},
            success:function (res) {
                if(res.status == 'S'){
                    fm.alert("解绑成功");
                    $('.pop-box').addClass('hide');
                    if(go == 1){
                        location.href="{BEESCRM::U('/base/store/bound',array(store_id=>$store_id))}/user_id/"+user_id+"/go/"+go;
                    }else{
                        location.href="{BEESCRM::U('/base/store/bound',array(store_id=>$store_id))}/user_id/"+user_id+"/account_id/"+account_id+"/go/"+go;
                    }
                    
                } else {
                    fm.alert(res.message);
                }
            }
        });
    });
</script>
<include file="commonJs" />
<include file="footer" />